package com.dcw.lixb.designmode.chain_of_responsibility;

/**
 * @author lixiaobin
 * @date 2020-07-23 16:25:31
 * @desc 描述信息
 */
public class ChainMain {
    public static void main(String[] args) {
        InfoLogger infoLogger = new InfoLogger();
        DebugLogger debugLogger = new DebugLogger();
        infoLogger.setNextLogger(debugLogger);
        WarningLogger warningLogger = new WarningLogger();
        debugLogger.setNextLogger(warningLogger);
        ErrorLogger errorLogger = new ErrorLogger();
        warningLogger.setNextLogger(errorLogger);

        infoLogger.logMessage(AbstractLogger.INFO, "这是 info log");
        infoLogger.logMessage(AbstractLogger.DEBUG, "这是 debug log");
        infoLogger.logMessage(AbstractLogger.WARNING, "这是 warning log");
        infoLogger.logMessage(AbstractLogger.ERROR, "这是 error log");
    }
}
